<template>
  <div class="h5-header" v-show="mainStore.isShowDialog">
    <div class="menu">
      <div class="close" @click="mainStore.isShowDialog = false">
        <CloseModal class="close-icon" />
      </div>
      <ul>
        <li @click="mainStore.isShowDialog = false">
          <a href="#/" class="nav-a">首页</a>
        </li>
        <li @click="mainStore.isShowDialog = false">
          <a href="#/news" class="nav-a">新闻中心</a>
        </li>
        <li @click="mainStore.isShowDialog = false">
          <a href="#/about" class="nav-a">关于我们</a>
        </li>
        <li @click="mainStore.isShowDialog = false">
          <a href="#/contact" class="nav-a">联系我们</a>
        </li>
        <li @click="mainStore.isShowDialog = false">
          <a href="#/join" class="nav-a">加入我们</a>
        </li>
      </ul>
    </div>
    <div class="nav-mask" @click="mainStore.isShowDialog = false"></div>
  </div>
</template>
<script>
import { mapStores } from 'pinia'
import { useMainStore } from '@/store/mainStore'
import CloseModal from '../common/icons/close-modal.svg'

export default {
  components: {
    // CustomText,
    CloseModal
  },
  computed: {
    ...mapStores(useMainStore)
  }
}

</script>
<style lang='scss' scope>
.menu {
  z-index: 11;
  background: #FAFBFC;
  position: fixed;
  -webkit-overflow-scroll: touch;
  width: 66.6%;
  right: 0;
  height: 100vh;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f8f8f8;
  -webkit-transition: all .5s;
  transition: all .5s;
  overflow: hidden;
  z-index: 100;
  .close {
    width: 100%;
    padding: 20px 15px 0 20px;
    text-align: right;
  }
  .close-icon {
    width: 40px;
    height: 40px;
  }
  ul {
    width: 100%;
    padding: 80px 0;
  }
  ul li {
    padding: 0 15px;
  }
  .nav-a {
    font-family: PingFangSC-Medium;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    padding: 20px 0;
    display: block;
    position: relative;
  }
  .nav-a:after {
    content: '';
    width: 7px;
    height: 7px;
    position: absolute;
    right: 0.2667vw;
    margin-top: 1.3333vw;
    transform: rotate(-45deg);
    border-bottom: 2px solid #ddd;
    border-right: 2px solid #ddd;
  }
  li:not(:last-child) .nav-a {
    border-bottom: 1px solid #eee;
  }
}
.nav-mask {
  background: rgba(0,0,0,.6);
  width: 100%;
  height: 100%;
  position: fixed;
  -webkit-overflow-scroll: touch;
  z-index: 99;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
</style>
